const router = require ("koa-router")();
const MembersModel = require("../../models/Members");
router.get("/api/last",async ctx=>{
    // 查询数据库第一条数据
    try {
        var data = await MembersModel.find({})
        ctx.body = {
            code: 200,
            msg: "最后一条数据",
            result: data[0]
        }
    } catch (err) {
        console.log("err")
        ctx.body = {
            code:400,
            msg:"请求的参数错误",
            request:"POST /api/delete"
        }
    }
})
module.exports = router;